// This is JDefenceTower, a simple tower defence style game
//
// Copyright (C) 2010 Maximilian Junker
//
// This program is free software; you can redistribute it and/or modify it under
// the terms of the GNU General Public License as published by the Free Software
// Foundation; either version 3 of the License, or (at your option) any later
// version.
//
// This program is distributed in the hope that it will be useful, but WITHOUT
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
// details.
//
// You should have received a copy of the GNU General Public License along with
// this program; if not, see <http://www.gnu.org/licenses/>.


package junker.defence.ui;

import java.awt.Toolkit;
import java.util.LinkedList;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;

import junker.defence.model.CreateRequest;
import junker.defence.model.Game;
import junker.defence.model.IGameEventListener;
import junker.defence.model.MoveRequest;
import junker.defence.model.Player;

public class GameUI implements IGameEventListener{
	private List<PlayerUI> playerUis = new LinkedList<PlayerUI>();
	private Logger logger = Logger.getLogger(GameUI.class.getName());
	
	public GameUI(){
		for(Player p : Game.getInstance().getPlayers()){
			PlayerUI pui = new PlayerUI(p);
			playerUis.add(pui);
			pui.setSize(930,930);
			pui.setVisible(true);
		}
		Game.getInstance().addGameEventListener(this);
	}

	@Override
	public void stepComplete() {
		logger.log(Level.FINEST,"Step Complete");
		for(PlayerUI p : playerUis){
			p.updateUI();
		}
	}
	
	
}
